package com.yitiao.dto;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> {
    public List<T> records;
    public long total;

    public PageResult(IPage<T> page) {
        this.total = page.getTotal();
        this.records = page.getRecords();
    }
}
